package lab02.test17;

public class ArrayMinimum implements Extremum {
    int min;
    int minLocation;

    @Override
    public void getExtrtmum(int[] array) {
        minLocation = -1;
        min = array[0];
        for (int i = 0; i < array.length; i++) {
            if (array[i] < min) {
                min = array[i];
                minLocation = i;
            }
        }
        System.out.println("最小值:" + min);
        System.out.println("最小值的位置:" + "第" + (minLocation + 1) + "个数.");
    }
}
